Skip to content

azurerm_container_registry: Support azuread_authentication_as_arm_policy_enabled, role_assignment_mode and network_rule_bypass_allowed_for_tasks#31667

Merged
jackofallops merged 4 commits into
hashicorp:mainfrom
magodo:acr_20251101_new_props
Jul 8, 2026
Merged

azurerm_container_registry: Support azuread_authentication_as_arm_policy_enabled, role_assignment_mode and network_rule_bypass_allowed_for_tasks#31667
jackofallops merged 4 commits into
hashicorp:mainfrom
magodo:acr_20251101_new_props

Conversation

@magodo

@magodo magodo commented Feb 4, 2026

Copy link
Copy Markdown
Collaborator

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

After upgrading the API version of ACR to 2025-11-01, there are a few new properties introduced:

The default values are set per the API behavior (manually checked) and API spec definition.

Additionally, I've removed the checkNameAvailability API call during the Create function, which has no obvious benefit and is now failing with 503:

{
  "error": {
    "code": "ServiceUnavailable",
    "message": "Unable to perform post/subscriptions/checkNameAvailability. Please try after some time."
  },
  "status": "Failed"
}

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.
    For example: “resource_name_here - description of change e.g. adding property new_property_name_here

Changes to existing Resource / Data Source

  • I have added an explanation of what my changes do and why I'd like you to include them (This may be covered by linking to an issue above, but may benefit from additional explanation).
  • I have written new tests for my resource or datasource changes & updated any relevant documentation.
  • I have successfully run tests with my changes locally. If not, please provide details on testing challenges that prevented you running the tests.
  • (For changes that include a state migration only). I have manually tested the migration path between relevant versions of the provider.

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)
💤 TF_ACC=1 go test -v -run='TestAccContainerRegistry_update' ./internal/services/containers
=== RUN   TestAccContainerRegistry_update
=== PAUSE TestAccContainerRegistry_update
=== CONT  TestAccContainerRegistry_update
--- PASS: TestAccContainerRegistry_update (215.76s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/containers    215.779s

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

  • azurerm_resource - support for the thing1 property [GH-00000]

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Enhancement
  • Breaking Change

Related Issue(s)

Fixes #29599

AI Assistance Disclosure

  • AI Assisted - This contribution was made by, or with the assistance of, AI/LLMs

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the provider.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Note

If this PR changes meaningfully during the course of review please update the title and description as required.

…policy_enabled` and `role_assignment_mode`
@magodo magodo changed the title azurerm_container_registry: Support azuread_authentication_as_arm_policy_enabled and role_assignment_mode azurerm_container_registry: Support azuread_authentication_as_arm_policy_enabled, role_assignment_mode and network_rule_bypass_allowed_for_tasks Feb 18, 2026
@catriona-m

Copy link
Copy Markdown
Member

/test

@hc-github-team-tf-azure

Copy link
Copy Markdown
Collaborator

@magodo - One or more tests failed in this PR. Please review the failures.

Build: 696348
PR: #31667

Total: 19
Passed: 17
Failed: 2
Test Duration: 0h 15m 36s

Test Details
StatusTest NameDuration
✅ PASSTestAccContainerRegistry_requiresImport107.359s
✅ PASSTestAccDataSourceAzureRMContainerRegistry_basic115.911s
✅ PASSTestAccDataSourceAzureRMContainerRegistry_dataEndpointPremium120.401s
✅ PASSTestAccContainerRegistry_basic138.924s
✅ PASSTestAccContainerRegistry_basicManagedStandard139.908s
❌ FAILTestAccContainerRegistry_complete66.544s
❌ FAILTestAccContainerRegistry_update70.718s
✅ PASSTestAccContainerRegistry_basicManagedPremium124.644s
✅ PASSTestAccContainerRegistry_basic2Premium2basic187.316s
✅ PASSTestAccContainerRegistry_zoneRedundancy133.287s
✅ PASSTestAccContainerRegistry_networkAccessProfileUpdate180.852s
✅ PASSTestAccContainerRegistry_networkAccessProfileIp205.48s
✅ PASSTestAccContainerRegistry_geoReplicationZoneRedundancy220.36s
✅ PASSTestAccContainerRegistry_geoReplicationRegionEndpoint168.796s
✅ PASSTestAccContainerRegistry_anonymousPull226.384s
✅ PASSTestAccContainerRegistry_dataEndpoint230.053s
✅ PASSTestAccContainerRegistry_geoReplicationLocation594.969s
✅ PASSTestAccContainerRegistry_networkRuleBypassOption219.192s
✅ PASSTestAccContainerRegistry_encryption319.219s

@magodo

magodo commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator Author

@catriona-m Thanks for looking into the PR. The two failures seem to be a breaking change/deprecation in the same API version:

    Registry Name: "testacccr260630100132343716"): performing Create: unexpected status 400 (400 Bad Request) with error: ContentTrustUnsupported: The value 'enabled' for property 'status' in 'trustPolicy' is not supported. Content Trust is being deprecated and will be completely removed on March 31, 2028. Refer to https://aka.ms/acr/dctdeprecation for details and transition guidance.

As you can see, the same API version used to work for this trustPolicy.status=enabled, but now it changes the behavior to directly fail. Whilst since this is not directly related to the change/purpose of this PR, I'd tend to leave the fix/deprecation of the corresponding trust_policy_enabled attribute to another PR. WDY?

@jackofallops jackofallops left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @magodo - LGTM

Tests:
(failures are unrelated to changes)
Image

@jackofallops jackofallops merged commit 8f1b397 into hashicorp:main Jul 8, 2026
35 checks passed
@github-actions github-actions Bot added this to the v4.81.0 milestone Jul 8, 2026
@magodo

magodo commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

@jackofallops Thanks for merging this PR! I've opened a new one to deprecate the trust_policy_enabled, which causes the 2 failures in acctest: #32752. Hope you can take a look when you have the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

azurerm_container_registry - support role_assignment_mode

5 participants